package com.liuyi.liuyimodulardemo.crypto;

import cn.hutool.core.map.MapUtil;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.liuyi.framework.web.encrypt.Encrypt;
import com.liuyi.tools.web.resp.Response;
import com.liuyi.tools.web.resp.ResponseCall;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 加密测试controller
 * </p>
 *
 * @author Mr.Fmy
 * @since 2021-02-07
 */
@RestController
@RequestMapping("/crypto")
public class CryptoController {

    private Log log = LogFactory.get(Log.class);

    @PostMapping("/test")
    //要加这个注解
    @Encrypt
    public Response<Map<String, Object>> test(@RequestBody Map<String, Object> map) {
        log.info(MapUtil.join(map, ",", ":"));
        return ResponseCall.success(map);
    }
}
